package com.amado.rmi.sevice;

import com.amado.rmi.vo.Rule;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.List;

/**
 * Created by amado on 2018/12/12.
 */
public interface RuleService extends Remote {
    /**
     * 根据规则编号获取规则
     * <p>
     * 必须抛出RemoteException异常,否认则Client运行时会抛出<p>
     * java.rmi.server.ExportException: remote object implements illegal remote interface; nested exception is:
     *
     * @param ruleNo
     * @return
     */
    Rule getRule(String ruleNo) throws RemoteException;

    /**
     * 查询所有规则
     * 必须抛出RemoteException异常,否认则Client运行时会抛出<p>
     * java.rmi.server.ExportException: remote object implements illegal remote interface; nested exception is:
     *
     * @return
     */
    List<Rule> list()throws RemoteException;
}
